<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">

    function fun1(){}

    var fun2 = function (){}

    // ES6当中箭头函数
    let fun3 = function (name, age){
        // 函数体
    }

    fun3 = (name, age) => {
        // 函数体
    }

    let fun4 = a => {
        // 函数体
    }

    /**
     * let fun4 = function(a){
     *     函数体
     * }
     */

    // 没有参数的情况
    let fun5 = () => {}

    // ES6新增可变参数
    function fun6(name, age, ...num){
        console.log(name);
        console.log(age);
        console.log(num);
        console.log(num[0]);
        console.log(num[1]);
        console.log(...num);
    }

    fun6("大锤", 56, "小锤", 89);


</script>
</html>